#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@Author          : ricsy
@File            : icons.py
@Create Time     : 2025/6/8 06:02
@Last Modified   :
@Description     :
"""
# Nerd Fonts 字体：https://www.nerdfonts.com/cheat-sheet
ICONS_ELEMENT = {
    # 默认图标
    "default_icon": '<i class="nf nf-fa-file" style=""></i>',
    # 编程工具图标
    "pycharm_icon": '<i class="nf nf-dev-pycharm" style="color: #40cc16;"></i>',
    # 代码文件图标
    "py_icon": '<i class="nf nf-dev-python" style="color: #3e7bac;"></i>',
    "sh_icon": '<i class="nf nf-dev-python" style="color: #3e7bac;"></i>',
    "css_icon": '<i class="nf nf-custom-css", style= "color: #b86415;"></i>',
    "scss_icon": '<i class="nf nf-seti-css", style="color: #b86415;"></i>',
    "js_icon": '<i class="nf nf-fa-js" style="color: #ffb02e;"></i>',
    "ts_icon": '<i class="nf nf-dev-typescript" style="color: #00a6ed;"></i>',
    "html_icon": '<i class="nf nf-dev-html5" style="color: #e54c25;"></i>',
    "java_icon": '<i class="nf nf-dev-java" style="color: #5382a1;"></i>',
    "c_icon": '<i class="nf nf-dev-c" style="color: #555555;"></i>',
    "cpp_icon": '<i class="nf nf-dev-cpp" style="color: #f34b7d;"></i>',
    "go_icon": '<i class="nf nf-dev-go" style="color: #00add8;"></i>',
    "rust_icon": '<i class="nf nf-dev-rust" style="color: #dea584;"></i>',
    "php_icon": '<i class="nf nf-dev-php" style="color: #777bb3;"></i>',
    "ruby_icon": '<i class="nf nf-dev-ruby" style="color: #cc342d;"></i>',
    "perl_icon": '<i class="nf nf-dev-perl" style="color: #39457e;"></i>',
    "lua_icon": '<i class="nf nf-seti-lua" style="color: #000080;"></i>',
    "r_icon": '<i class="nf nf-dev-r" style="color: #276dc3;"></i>',
    # 压缩文件图标
    "zip_icon": '<i class="nf nf-seti-zip" style="color: #30a191;"></i>',
    "tar_icon": '<i class="nf nf-fa-file_archive" style="color: #30a191;"></i>',
    # 媒体文件图标
    "png_icon": '<i class="nf nf nf-md-file_png_box" style="color: #36b670;"></i>',
    "jpg_icon": '<i class="nf nf-md-file_jpg_box" style="color: #36b670;"></i>',
    # 文档文件图标
    "txt_icon": '<i class="nf nf-fa-file_text" style=""></i>',
    "md_icon": '<i class="nf nf-fa-markdown" style="color: #b446be;"></i>',
    "log_icon": '<i class="nf nf-oct-log" style="color: #b446be;"></i>',
    "json_icon": '<i class="nf nf-md-code_json" style="color: #d02fd5;"></i>',
    "toml_icon": '<i class="nf nf-custom-toml" style="color: #a69f92;"></i>',
    # 其他
    "terminal_icon": '<i class="nf nf-fa-terminal" style="color: #4d4d4d;"></i>',
}

DEFAULT_FILE_ICONS = {"symbol": "📄", "element": ICONS_ELEMENT["default_icon"]}
# 文件类型到图标的映射字典
FILE_ICONS = {
    # 压缩文件
    ".zip": {"symbol": "🗜", "element": ICONS_ELEMENT["zip_icon"]},
    ".gz": {"symbol": "🗜", "element": ICONS_ELEMENT["zip_icon"]},
    ".tar": {"symbol": "🗜", "element": ICONS_ELEMENT["tar_icon"]},
    ".rar": {"symbol": "🗜", "element": ICONS_ELEMENT["zip_icon"]},
    ".7z": {"symbol": "🗜", "element": ICONS_ELEMENT["zip_icon"]},
    # 代码文件
    ".py": {"symbol": "🐍", "element": ICONS_ELEMENT["py_icon"]},
    ".js": {"symbol": "🟨", "element": ICONS_ELEMENT["js_icon"]},
    ".ts": {"symbol": "🟦", "element": ICONS_ELEMENT["ts_icon"]},
    ".java": {"symbol": "", "element": ICONS_ELEMENT["java_icon"]},
    ".c": {"symbol": "", "element": ICONS_ELEMENT["c_icon"]},
    ".h": {"symbol": "", "element": ICONS_ELEMENT["c_icon"]},
    ".cpp": {"symbol": "", "element": ICONS_ELEMENT["cpp_icon"]},
    ".go": {"symbol": "", "element": ICONS_ELEMENT["go_icon"]},
    ".rs": {"symbol": "", "element": ICONS_ELEMENT["rust_icon"]},
    ".php": {"symbol": "🐘", "element": ICONS_ELEMENT["php_icon"]},
    ".rb": {"symbol": "💎", "element": ICONS_ELEMENT["ruby_icon"]},
    ".sh": {"symbol": "🐚", "element": ICONS_ELEMENT["terminal_icon"]},
    ".pl": {"symbol": "", "element": ICONS_ELEMENT["perl_icon"]},
    ".lua": {"symbol": "", "element": ICONS_ELEMENT["lua_icon"]},
    ".r": {"symbol": "ﳒ", "element": ICONS_ELEMENT["r_icon"]},
    ".html": {"symbol": "🌐"},
    ".css": {"symbol": "🎨", "element": ICONS_ELEMENT["css_icon"]},
    ".scss": {"symbol": "🎨", "element": ICONS_ELEMENT["scss_icon"]},
    # 配置文件
    ".yml": {"symbol": "⚙️"},
    ".yaml": {"symbol": "⚙️"},
    ".json": {"symbol": "⚙️", "element": ICONS_ELEMENT["json_icon"]},
    ".toml": {"symbol": "⚙️", "element": ICONS_ELEMENT["toml_icon"]},
    ".ini": {"symbol": "⚙️"},
    ".cfg": {"symbol": "⚙️"},
    ".log": {"symbol": "⚙️", "element": ICONS_ELEMENT["log_icon"]},
    ".conf": {"symbol": "⚙️"},
    ".env": {"symbol": "⚙️"},
    # 文档文件
    ".md": {"symbol": "📝", "element": ICONS_ELEMENT["md_icon"]},
    ".txt": {"symbol": "📄", "element": ICONS_ELEMENT["txt_icon"]},
    ".rst": {"symbol": "📜"},
    ".doc": {"symbol": "📑"},
    ".docx": {"symbol": "📑"},
    ".pdf": {"symbol": "📕"},
    ".ppt": {"symbol": "📊"},
    ".pptx": {"symbol": "📊"},
    ".xls": {"symbol": "📊"},
    ".xlsx": {"symbol": "📊"},
    ".csv": {"symbol": "📊"},
    # 媒体文件
    ".ico": {"symbol": "🖼️"},
    ".png": {"symbol": "🖼️", "element": ICONS_ELEMENT["png_icon"]},
    ".jpg": {"symbol": "🖼️", "element": ICONS_ELEMENT["jpg_icon"]},
    ".jpeg": {"symbol": "🖼️"},
    ".gif": {"symbol": "🖼️"},
    ".svg": {"symbol": "🖼️"},
    ".webp": {"symbol": "🖼️"},
    ".mp4": {"symbol": "🎬"},
    ".mov": {"symbol": "🎬"},
    ".avi": {"symbol": "🎬"},
    ".mp3": {"symbol": "🎵"},
    ".wav": {"symbol": "🎵"},
    ".ogg": {"symbol": "🎵"},
    # 其他常见类型
    ".sql": {"symbol": "🗃"},
    ".exe": {"symbol": "⚙️"},
    ".bin": {"symbol": "🔧"},
    ".dll": {"symbol": "⚙️"},
    ".so": {"symbol": "⚙️"},
    ".deb": {"symbol": ""},
    ".rpm": {"symbol": ""},
    ".app": {"symbol": ""},
}
